/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models.beans;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author Hoang Dong Tien
 */
public class Request extends org.apache.struts.action.ActionForm {

    private int requestUserId;
    private int eventId;
    private String status;
    public static final String STATUS_AWAITING = "awaiting";
    public static final String STATUS_ACCEPTED = "accepted";
    public static final String STATUS_REJECTED = "rejected";

    public int getEventId() {
        return eventId;
    }

    public void setEventId(int eventId) {
        this.eventId = eventId;
    }

    public int getRequestUserId() {
        return requestUserId;
    }

    public void setRequestUserId(int requestUserId) {
        this.requestUserId = requestUserId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        if (status.equalsIgnoreCase(Request.STATUS_AWAITING)
                || status.equalsIgnoreCase(Request.STATUS_ACCEPTED)
                || status.equalsIgnoreCase(Request.STATUS_REJECTED)) {
            this.status = status.toLowerCase();
        }
    }

    public Request() {
        super();
        this.requestUserId = 0;
        this.eventId = 0;
        this.status = Request.STATUS_AWAITING;
    }

     @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();

        return errors;
    }
}
